<?php defined('APP_PATH') or exit('Access Denied');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>更新菜单</title>
<link rel="stylesheet" type="text/css" href="vonuo/static/css/vonuo.css">
<script type="text/javascript" src="vonuo/static/js/jquery.min.js"></script>
<script type="text/javascript">
function check(){
	if($.trim($("input[name='name']").val()) == ''){
		$("#need_name").html("<strong style='color:red;'>请输入菜单名称！</strong>");
		$("input[name='name']").focus();
		return false;
	}else{
		$("#need_name").html("<strong style='color:red;'>√</strong>");
	}
	if($.trim($("input[name='url']").val()).match(/^[a-z\/]{3,20}$/g) == null){
		$("#need_url").html("<strong style='color:red;'>路径格式为[3-20]位小写字母和斜线组成！</strong>");
		$("input[name='url']").focus();
		return false;
	}else{
		$("#need_url").html("<strong style='color:red;'>√</strong>");
	}
	return true;
}
</script>
</head>

<body>
<div class="gs_wraper gs_p_l0">
	<div class="title">
		<a href="<?php echo spUrl('menu','lis');?>">菜单列表</a>
		<a href="javascript:;"  class="hover">更新菜单</a>
	</div>
	<form action="<?php echo spUrl('menu','doupd',array('id'=>$info['id']));?>" method="post">
	<div class="tab_box" id="con_one_1">
		<table border="0" cellspacing="0" cellpadding="0" class="table_btm">
			<tr>
				<td class="txt_right txt_s_blue">菜单名称：</td>
				<td>
					<input name="name" type="text" value="<?php echo $info['name'];?>" class="blue_input input_w_175" />
					<span id="need_name"></span>
				</td>
			</tr>
			<tr>
				<td class="txt_right txt_s_blue">父级菜单：</td>
				<td>
					<select name="pid" class="blue_input input_w_175 f_left"><option value="default">不做修改</option><option value="0">顶级菜单</option>
					<?php foreach($menu as $row){?><option value="<?php echo $row['id'];?>"><?php echo $row['format'];?></option><?php }?>
					</select>
					<span id="need_pid" style="margin-left:8px;"></span>
				</td>
			</tr>
			<tr>
				<td class="txt_right txt_s_blue">访问路径：</td>
				<td>
					<input name="url" type="text" value="<?php echo $info['url'];?>" class="blue_input input_w_175" />
					<span id="need_url"></span>
				</td>
			</tr>
			<tr>
				<td class="txt_right txt_s_blue">指定排序：</td>
				<td><input name="odnum" value="<?php echo $info['odnum'];?>" type="text" class="blue_input input_w_175" /></td>
			</tr>
			<tr>
				<td class="txt_right txt_s_blue" valign="top">备注信息：</td>
				<td><textarea name="note" cols="40" rows="4" class="blue_textarea"><?php echo $info['note'];?></textarea></td>
			</tr>
			<tr>
				<td></td>
				<td><a href="javascript:;" onclick="if(check()){$('form').submit();}" class="sure_submit f_left time">确 定</a><a href="<?php echo spUrl('menu','lis');?>" class="return_btn f_left">返 回</a></td>
			</tr>
		</table>
	</div>
	</form>
</div>
</body>
</html>